package com.lx.pc.service.accountlog.impl;

import java.math.BigInteger;
import java.util.List;

import org.springframework.stereotype.Service;

import com.lx.pc.domain.entity.accountlog.AccountLogEntity;
import com.lx.pc.domain.vo.accountlog.AccountLogVo;
import com.lx.pc.mybatis.repository.accountlog.AccountLogRepository;
import com.lx.pc.service.AbstractService;
import com.lx.pc.service.accountlog.IAccountLogService;
import com.lx.pc.utils.OmsPage;

@Service("accountLogService")
public class AccountLogServiceImpl extends AbstractService<AccountLogEntity, AccountLogVo, BigInteger, AccountLogRepository> implements IAccountLogService{

	@Override
	public int findByAccountLogCount(AccountLogVo accountLog) {
		return repository.findByAccountLogCount(accountLog);
	}

	@Override
	public OmsPage<AccountLogVo> findByAccountLog(AccountLogVo accountLog, Integer page, Integer size) {
		OmsPage<AccountLogVo> pages = new OmsPage<AccountLogVo>();
		pages.setTotal(repository.findByAccountLogCount(accountLog));
		List<AccountLogEntity> list = repository.findByAccountLog(accountLog,page = (page - 1) * size,size);
		pages.setResult(etoV(list));
		return pages;
	}

}
